<template>
  <el-form ref="basicInfoForm" :model="info" :rules="rules" label-width="150px">
    <el-row>
      <el-col :span="12">
        <el-form-item label="表名称" prop="name">
          <el-input placeholder="请输入仓库名称" v-model="info.name" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="表描述" prop="desc">
          <el-input placeholder="请输入" v-model="info.desc" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="实体类名称" prop="entityName">
          <el-input placeholder="请输入" v-model="info.entityName" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="作者" prop="author">
          <el-input placeholder="请输入" v-model="info.author" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="备注" prop="remark">
          <el-input type="textarea" :rows="3" v-model="info.remark"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script setup>
defineProps({
  info: {
    type: Object,
    default: null
  }
});

// 表单校验
const rules = ref({
  name: [{ required: true, message: "请输入表名称", trigger: "blur" }],
  desc: [{ required: true, message: "请输入表描述", trigger: "blur" }],
  entityName: [{ required: true, message: "请输入实体类名称", trigger: "blur" }],
  author: [{ required: true, message: "请输入作者", trigger: "blur" }]
});
</script>
